import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DefaultLayoutComponent } from './component/default-layout/default-layout.component';

const routes: Routes = [
  {
    path: 'welcome',
    loadChildren: () => import('src/app/pages/welcome/welcome.module').then(m => m.WelcomeModule)
  },
  {
    path: 'system',
    component: DefaultLayoutComponent,
    children: [
      {
        path: '',
        loadChildren: () => import('src/app/pages/system/system.module').then(m => m.SystemModule)
      }
    ]
  },
  {
    path: '',
    pathMatch: 'full',
    redirectTo: '/welcome/login'
  },
  {
    path: '**', // 当所有路由都没有匹配到时（一般用作404页面）
    pathMatch: 'full',
    redirectTo: '/welcome/login'
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class CoreRoutingModule { }
